<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
    <title>代理管理</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta name="author" content="刘代应">
	<meta name="hashcode" content="699483078">
	
	<script>window.duteTag="lz";</script>
	<script type="text/javascript" src="/admin/js/dute-1.0.js"></script>
	<script type="text/javascript" src="/admin/js/jquery-1.7.1.min.js"></script>
	
	<script type="text/javascript" src="/admin/js/lazy3q.ui.js"></script>
	<script>
		document.write('<link rel="stylesheet" type="text/css" href="/admin//css/'+($.cookie('theme')||'elegant')+'/lazy3q.ui.css" /> ');
	</script>
	
	
	<!-- 用户自定义js(懒加载) -->
	<script type="text/javascript" src="/admin/js/define.js"></script>
	<!-- 用户自定义css样式 -->
	<link rel="stylesheet" type="text/css" href="/admin/css/define.css"/>
	<!-- icon font -->
  	<link rel="stylesheet" href="/admin/css/iconfont.css">
	
	<script type="text/javascript">
		window.basePath="/";
		window.contextPath="/admin/";
		window.canQuery=true;
		window.className = "com.distribute.framework.model.Agent";
		window.modelPath = "/admin/agents/agent";
		window.hashcode = "699483078";
	</script>
		
	<!-- 感谢My97DatePicker出品的时间控件 -->
	<script language="javascript" type="text/javascript" src="/admin/js/My97DatePicker/WdatePicker.js"></script>
	
	<!------------------------VIEW_HTML_HEAD------------------------>
	<!------------------------VIEW_HTML_HEAD------------------------>	
	
</head>
<script>

Page({
  data:{
    
  },
  onLoad: function(options) {
  	var THIS = this;
  	$.getAjax("agent.list.do",options,function(protocol){
  		window.protocol = protocol;
  		if(protocol.message){
  			$.toast(protocol.message);
  		}
  		THIS.setData(protocol.data);
  		
  		/******************VIEW_HTML_SET_DATA******************/
  		/******************VIEW_HTML_SET_DATA******************/
  	});
  }
});

</script>
<body style="display:none;">



<!------------------------VIEW_HTML_BOTTOM------------------------>
<!------------------------VIEW_HTML_BOTTOM------------------------>

<div lz:if="{{highlight}}" class="highlight" id="highlight" style="line-height:32px;text-indent:20px;">
	<span style="float:right;margin-right:15px;cursor:pointer;" onclick="$('#highlight').remove();">X</span>
	<span>{{highlight}}</span>
</div>

<table class="" border="0" cellspacing="0" cellpadding="0"><tr><td>
	
	<div lz:if="{{notQuery!='true'}}" class="title">
		<a href="javascript:void(0);" onclick="try{parent.current.close();}catch(e){};try{$.closeModalDialog();}catch(e){};" class="linker">
			<img class="iconA" align="absmiddle" src="/admin/images/icons/Badge-multiply.png"/>
			<span class="iconB iconfont icon-icon11"></span>
			关闭页面
		</a>
		
		<a href="javascript:void(0);" class='iconA linker imize {{imize=="minimize"?"minimize":"maximize"}}'>
			<img align="absmiddle" class="up" src="/admin/images/icons/Arrow up.png"/>
			<img align="absmiddle" class="down" src="/admin/images/icons/Arrow down.png"/>
			展开收起
		</a>
		<a href="javascript:void(0);" class='iconB linker imize {{imize=="minimize"?"minimize":"maximize"}}'>
			<span class="iconfont up icon-shang"></span>
			<span class="iconfont down icon-xia"></span>
			展开收起
		</a>
		
		<a href="javascript:void(0);" class="linker setting">
			<img align="absmiddle" class="iconA" src="/admin/images/icons/20088256421529677801.png"/>
			<span class="iconB iconfont icon-cogs"></span>
			页面设置
		</a>
		<a href="?" class="linker">
			<img align="absmiddle" class="iconA" src="/admin/images/icons/2008825642250778028.png"/>
			<span class="iconB iconfont icon-shuaxin2"></span>
			重新加载
		</a>
		
			
			
		<a lz:if="{{canExport}}" href="javascript:void(0);" onclick="exportXls();" class="linker">
			<img align="absmiddle" class="iconA" src="/admin/images/icons/20088256427828778018.png"/>
			<span class="iconB iconfont icon-xiazai"></span>
			数据导出
		</a>
			
			
		
		<a lz:if="{{haveQuerys}}" class="toggler" href="javascript:void(0);"><span class="{{window.shortcuts!='hide'?'on':''}}"></span></a>
		<div class="caption">
			<span class="iconB iconfont icon-friend"></span>
			{{title||"代理管理"}}
		</div>
	</div>
	
	
	<div lz:if="{{canQuery && notQuery!='true'}}" class="plate" style='{{imize=="minimize"?"display:none;":""}}'>
		
		<form ref="Agent" class="query" id="queryForm" action="agent.html?" method="get">
			
			<lz:include src="agent.query.html?v=1425983744"></lz:include>
	
			
			<div class="option" style="float:left;">
				<table border="0" cellspacing="0" cellpadding="0">
				  <tr>
				    <td>
						<input type="hidden" name="all" value="{{all}}" />
						<input type="hidden" name="fields" value="{{fields}}" />
						<lz:block lz:if="{{onlyQuery=='true'}}">
						 	<input type="hidden" name="onlyQuery" value="{{onlyQuery}}" />
							<button class="button" onclick="top['complete_'+window.name]($('#queryForm').params());" type="button">
								&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
								<span class="iconB iconfont icon-weibiaoti8"></span>
								确定&nbsp;&nbsp;</button>
							<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="$.closeModalDialog();" type="button">
								&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
								<span class="iconB iconfont icon-icon11"></span>
								取消&nbsp;&nbsp;</button>
						</lz:block>
						<lz:block lz:if="{{onlyQuery!='true'}}">
							<button class="button" type="submit" style="height:30px;line-height:28px;">
								&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Zoom.png"/>
								<span class="iconB iconfont icon-chazhao"></span>
								查询&nbsp;&nbsp;</button>	
						</lz:block>
						<lz:block lz:if="{{alias=='join'||alias=='select'}}">
							<button class="button onok" type="button">
								&nbsp;<img align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
								确定&nbsp;&nbsp;</button>
							<button class="button oncancel" type="button">
								&nbsp;<img align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
								放弃&nbsp;&nbsp;</button>
						</lz:block>
					</td>
				  </tr>
				</table>
				<div class="clear"></div>
			</div>
			
			<div class="line"></div>
			
		</form>
	
	</div>
	

</td></tr><tr><td>

	
	<!------------------------VIEW_HTML_MIDDLE------------------------>
	<!------------------------VIEW_HTML_MIDDLE------------------------>

	
	<div class="{{notQuery!='true'?'content':''}}" style="{{notQuery?'margin:8px;':''}}">
	
	    <div class="toolbar">
	    
	      	{{before$toolbar}}
	    	
			
			
			
			<button lz:if="{{canAdd}}" class="add" onclick='navigate("/admin/agents/agent.edit.html",{edittype:"insert"},window)'>
				添加
			</button>
			
		  
	      
		  	    	
			<button lz:for="{{menus}}" lz:for-item="handle" type="button" class="edit" onclick="HandleMenu('{{handle}}');">
				{{handle}}
			</button>
	    
			<button type="button" class="all" onclick="$('.check').attr('checked',true)">
				全选
			</button>
			<button type="button" class="invert" onclick="$('.check').click();">
				反选
			</button>
			<dl ref="com.distribute.framework.model.Agent" class="display dropdowan" style="margin-left:30px;">
				<dt>
					<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/display.png"/>
					<span class="iconB iconfont icon-liebiao"></span>
					{{!fields?"主要内容":""}}{{fields=="*"?"全部内容":""}}{{(fields && fields!="*")?"自定义显示":""}}
				</dt>
				<dd>
					<table class="shadow" border="0" cellspacing="0" cellpadding="0">
					<tbody><tr>  <td class="l"></td>  <td class="c">						
						<a href="?fields=&{{lz.queryString('fields')}}">主要内容</a>
						<a href="?fields=*&{{lz.queryString('fields')}}">全部内容</a>
						<a fields="define" href="?{{lz.queryString('fields')}}">自定义显示</a>
					</td>  <td class="r"></td></tr><tr>  <td class="bl"></td>  <td class="b"></td>  <td class="br"></td></tr>
					</tbody></table>
				</dd>
			</dl>
			<dl lz:if="{{canEdit}}" ref="com.distribute.framework.model.Agent" class="batch dropdowan">
				<dt>
					<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/20088256421529677807.png"/>
					<span class="iconB iconfont icon-jilu-copy"></span>
					批量修改
				</dt>
				<dd>
					<table class="shadow" border="0" cellspacing="0" cellpadding="0">
					<tbody><tr>  <td class="l"></td>  <td class="c">
				
					
				
					
				
					
				
					
				
					
				
					
				
					
				
					
				
					
				
					
						<a href="javascript:void(0);" onclick="UpdateSel('status')">状态</a>
					
				
					</td>  <td class="r"></td></tr><tr>  <td class="bl"></td>  <td class="b"></td>  <td class="br"></td></tr>
					</tbody></table
				</dd> 
			</dl>
			
			{{after$toolbar}}
			
		</div>		
				
		<lz:include id="listTemplate" src="agent.list.html?v=1714318765"></lz:include>
		
		<div lz:if="{{!list.length}}" class="nodata"><br/><br/><br/><br/><br/><br/><br/><center>暂无数据</center><br/><br/><br/><br/><br/><br/><br/><br/></div>
		
		<div class="pages b">
			<lz:include src="/admin/page.html"></lz:include>
		</div>
	  
  </div>

 </td></tr></table>
 


<!------------------------VIEW_HTML_BOTTOM------------------------>
<!------------------------VIEW_HTML_BOTTOM------------------------>


</body>
<script>

	window.navigate = top.$.open;
	window.href = function(url){
	   window.navigate(url,{edittype:"detail"},window);
	}

	$(function(){
		//修改代理管理任意字段
		$(document).on("dblclick",".table tbody td.td",function(){
			if((""+window.protocol.data.UID)!="0")return;
			var url = "/admin/agents/agent.edit.html";
			var params = {id:$(this).parents("tr:eq(0)").attr("id"),edittype:"any",fields:$(this).attr("ref")};
			top.$.open(url,params,window);
		});
		$(".toolbar .batch dd a").click(function(){
			return false;
		});
		//批量修改任意字段
		$(".toolbar .batch dd").click(function(){
			if((""+window.protocol.data.UID)!="0")return;
			var ids = "";
			$(".check:checked").each(function(i){
				if(ids!="")ids+=",";
				ids+=$(this).val();
			});
			var struct = $.getObject("/admin/struct.do",{className:"com.distribute.framework.model.Agent",struct:true});
			var strHtml = "";
			for(var o in struct){
				
				if("id,uid".indexOf(struct[o].name)>-1)continue;
				strHtml+="<label class='syllable'><input value='"+struct[o].name+"' type='checkbox'/>"+struct[o].caption+"&nbsp;&nbsp;</label>";
			}
			var div = $("<div style='width:"+($(window).width()/2)+"px;'><div style='padding:5px;' class='highlight'></div><div>"+strHtml+"</div></div>");
			if(ids!=""){
				div.find(".highlight").html("当前选中了"+(ids.split(",").length)+"条要修改的数据");
			}else{
				div.find(".highlight").html("当前将批量修改"+protocol.data.pageInfo.count+"条查询到的数据");
			}
			var dialog = div.dialog({
				title:"请选择要批量修改字段",modal:true,
				onOk:function(){
					if(div.find("input:checked").size()==0){
						$.toast("未选中任何要批量修改的字段");
						return false;
					}
					var url = "/admin/agents/agent.edit.html";
					var params = {edittype:"any"};
					if(ids!=""){
						params["ids"]=ids;
					}else{
						params["PARAMS"]=encodeURI(JSON.stringify(protocol.data.PARAMS));
					}
					var strFields = "";
					div.find("input:checked").each(function(){
						if(!strFields=="")strFields+=",";
						strFields+=$(this).val();
					});
					params.fields = strFields;
					top.$.open(url,params,window);
				}
			});
		});
	});

	$(function(){
		if(parent.setit){
			parent.setit("/admin/agents/agent.html","代理管理","/admin//images/icons/1674092804.png");
		}
	});
	
	
	
	
	
	

</script>
</html>